<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EPics login</title>
</head>
<body>

<c:if test="${ empty user }">
	<form action="./LoginController" method="post" accept-charset="UTF-8">
		<table>
			<tr>
				<td><label for="emailAddress">Email</label></td>
				<td><input name="emailAddress" type="email"></td>
			</tr>
			
			<tr>
				<td><label for="password">Password</label></td>
				<td><input name="password" type="password"></td>
			</tr>
			
			<tr>
				<td><input type="submit" value="Log in"></td>
			</tr>
		</table>
	</form>
	
	<a href="./register.jsp">Register</a>
</c:if>
<c:if test="${ not empty sessionScope.user }">
	<c:out value="Already logged in."></c:out> <br/>
	<a href="./LogoutController">Log out</a><br/>
</c:if>
<a href="./HomeController">Home</a> <br/>

</body>
</html>